import React from 'react';
import ReactModal from 'react-modal';

ReactModal.setAppElement('#root');

interface ModalProps {
  isOpen: boolean;
  onRequestClose: () => void;
  onConfirm: () => void;
  content: string;
}

const Modal: React.FC<ModalProps> = ({ isOpen, onRequestClose, onConfirm, content }) => {
  return (
    <ReactModal 
      isOpen={isOpen}
      onRequestClose={onRequestClose}
      contentLabel="Confirmation Modal"
      className="modal"
      overlayClassName="overlay"
    >
      <div>{content}</div>
      <button onClick={onConfirm}>确认</button>
      <button onClick={onRequestClose}>取消</button>
    </ReactModal>
  );
};

export default Modal;
